<template>
    <div class="earn-detail-main">
        <van-nav-bar left-arrow @click-left="onClickLeft">
            <template #left>
                <van-icon :name="backicon" size="20"/>
            </template>
            <template #title>
                <span class="hometitle">推荐详情</span>
            </template>
        </van-nav-bar>

        <div class="user-info-title">
            <p>ID:{{Info.info.user_code}}</p>
            <div class="userHeader">
                <img :src="Info.info.head_pic" alt="">
            </div>
            <p>{{Info.info.mobile | changePhone}}</p>
        </div>

        <div class="class-template">
            <van-cell-group>
                <van-cell>
                    <template #title>
                        <span style="color:#333;">推荐金额</span>
                    </template>
                    <template #default>
                        <span style="font-family: 'DINPro-Bold';color:#333;font-size:15px;">￥ {{Info.money}}</span>
                    </template>
                </van-cell>
                <van-cell title="注册时间">
                    <template #default>
                        <span style="font-family: 'DINPro Medium';">{{Info.info.agent_time}}</span>
                    </template>
                </van-cell>
            </van-cell-group>
        </div>

        
    </div>
</template>
<script>
export default {
    data(){
        return{
            backicon:require('../../assets/img/backicon.png'),
            Info:{},
            dateType:""
        }
    },
    mounted(){
        this.Info=JSON.parse(localStorage.getItem("recomcount-detail"))
        console.log(this.Info)
        this.dateType=this.$route.query.type
    },
    filters:{
        formateDate(time){
            return moment(time*1000).format('YYYY-MM-DD HH:mm:ss')
        },
        changePhone(val){
            if(val!=undefined){
                return val.replace(/(^\d{3}|\d{4}\B)/g,"$1 ");
            }
        }
    },
    methods:{
        onClickLeft(){
            this.$router.push({path:"/recomcount",query:{type:this.dateType}})
        }
    }
}
</script>
<style lang="less" scoped>
.font-SC(){
    font-family: "PingFang SC","Microsoft YaHei";
}
.earn-detail-main{
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    background-color: #fff;
    .hometitle{
        font-size: 18px;
        .font-SC();
        font-weight: bold;
        color: #000;
        line-height: 46px;
    }


    .user-info-title{
        width: 345px;
        height: 90px;
        background-color: #000;
        margin: 0 auto;
        border-radius: 5px;
        margin-top: 10px;
        display: flex;
        justify-content: space-around;
        align-items: flex-end;
        box-shadow: 0 5px 10px rgba(51, 51, 51, .5);
        .userHeader{
            width: 45px;
            height: 45px;
            border-radius: 50%;
            overflow: hidden;
            margin-bottom: 30px;
            margin-left: -20px;
            border: 2px solid #fff;
            img{
                width: 45px;
                
            }
        }
        
        p{
            font-family: "DINPro-Bold";
            font-size: 12px;
            color: #fff;
            margin-bottom: 15px;
        }
    }

    .class-template{
        width: 345px;
        height: auto;
        margin: 10px auto;
        padding: 10px 20px;
        border-radius: 10px;
        box-shadow: 3px 0 20px rgba(153, 153, 153, .35);
        /deep/.van-cell{
            padding: 0;
            .font-SC();
            font-size: 12px;
            color: #999;
            line-height: 25px;
        }
        /deep/.van-cell:not(:last-child)::after{
            display: none;
        }
        /deep/.van-cell__value{
            .font-SC();
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
        }
        .tian{
            .font-SC();
            font-weight: bold;
            color: #333;
            font-size: 12px;
        }
    }

}
</style>